package com.weitu.worklicense.service.impl;

import com.weitu.worklicense.entity.HighLicense;
import com.weitu.worklicense.entity.HighLicenseCriteria;
import com.weitu.worklicense.mapper.HighLicenseMapper;
import com.weitu.worklicense.service.HighLicenseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class HighLicenseServiceImpl implements HighLicenseService {
    private final HighLicenseMapper highLicenseMapper;

    private static final Logger logger = LoggerFactory.getLogger(HighLicenseServiceImpl.class);

    @Autowired
    public HighLicenseServiceImpl(HighLicenseMapper highLicenseMapper) {
        this.highLicenseMapper = highLicenseMapper;
    }

    @Override
    public int countByCriteria(HighLicenseCriteria example) {
        int count = this.highLicenseMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public HighLicense selectByPrimaryKey(String id) {
        return this.highLicenseMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<HighLicense> selectByCriteria(HighLicenseCriteria example) {
        return this.highLicenseMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.highLicenseMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(HighLicense record) {
        return this.highLicenseMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(HighLicense record, HighLicenseCriteria example) {
        return this.highLicenseMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(HighLicense record) {
        return this.highLicenseMapper.insertSelective(record);
    }

    @Override
    @Transactional
    public int updateByPrimaryKey(HighLicense record) {
        return this.highLicenseMapper.updateByPrimaryKey(record);
    }
}